﻿using Abp.Application.Services;
using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace WanFang.Test
{
    public class HistoryDataService : IHistoryDataService, IApplicationService
    {
        private readonly IRepository<HistoryData> _repository;
        public HistoryDataService(IRepository<HistoryData> repository)
        {
            _repository = repository;
        }
        public HistoryData Get(int id)
        {
            return _repository.Get(id);
        }
        public IList<HistoryData> GetList()
        {
           return _repository.GetAll().ToList();
        }
        public void Add(HistoryData entity)
        {
            _repository.Insert(entity);
        }
        public void Add(List<HistoryData> lst)
        {
            foreach(var m in lst)
            {
                _repository.Insert(m);
            }
        }
        public void Update(HistoryData entity)
        {
            _repository.Update(entity);
        }
        public void Delete(HistoryData entity)
        {
            _repository.Delete(entity);
        }
        public void Delete(int id)
        {
            _repository.Delete(id);
        }
    }
}
